﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Styles/Admin.master" AutoEventWireup="true" CodeFile="modify.aspx.cs" Inherits="Administration_content_add" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="HTMLEditor" %>  

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>" 
        SelectCommand="SELECT [navigationName], [navigationID], [navigationPosition] FROM [Navigation] ORDER BY [navigationPosition]">
    </asp:SqlDataSource>
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"></ajaxToolkit:ToolkitScriptManager>

    <div class="form">
        <asp:HiddenField ID="ContentFormId" runat="server" />
        <asp:HiddenField ID="ContentFormDate" runat="server" />
        <asp:Label ID="Label1" runat="server" Text="Title:"></asp:Label>
        <br />
        <asp:TextBox runat="server" ID="ContentFormTitle" CausesValidation="True" MaxLength="15"/>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ControlToValidate="ContentFormTitle" Display="Dynamic" 
            ErrorMessage="Title has to be typed in" ForeColor="Red"></asp:RequiredFieldValidator>
        <br /> 
        <br />
        <asp:Label ID="Label2" runat="server" Text="Content:"></asp:Label>
        <ajaxToolkit:HtmlEditorExtender ID="ContentFormEditor" TargetControlID="ContentFormText" runat="server" >
            <Toolbar> 
                <ajaxToolkit:Undo />
                <ajaxToolkit:Redo />
                <ajaxToolkit:Bold />
                <ajaxToolkit:Italic />
                <ajaxToolkit:Underline />
                <ajaxToolkit:StrikeThrough />
                <ajaxToolkit:Subscript />
                <ajaxToolkit:Superscript />
                <ajaxToolkit:JustifyLeft />
                <ajaxToolkit:JustifyCenter />
                <ajaxToolkit:JustifyRight />
                <ajaxToolkit:JustifyFull />
                <ajaxToolkit:InsertOrderedList />
                <ajaxToolkit:InsertUnorderedList />
                <ajaxToolkit:CreateLink />
                <ajaxToolkit:UnLink />
                <ajaxToolkit:RemoveFormat />
                <ajaxToolkit:Cut />
                <ajaxToolkit:Copy />
                <ajaxToolkit:Paste />
                <ajaxToolkit:BackgroundColorSelector />
                <ajaxToolkit:ForeColorSelector />
                <ajaxToolkit:FontSizeSelector />
                <ajaxToolkit:Indent />
                <ajaxToolkit:Outdent />
                <ajaxToolkit:InsertHorizontalRule />
                <ajaxToolkit:HorizontalSeparator />
            </Toolbar>
        </ajaxToolkit:HtmlEditorExtender>
        <asp:TextBox ID="ContentFormText" runat="server" TextMode="MultiLine" Width="700px" Height="150px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            ControlToValidate="ContentFormText" Display="Dynamic" 
            ErrorMessage="Text has to be typed in" ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
        <br />
        <asp:Label ID="Label3" runat="server" Text="Navigation item:"></asp:Label>
        <br />
        <asp:DropDownList ID="ContentFormNavigation" runat="server" 
            DataSourceID="SqlDataSource1" DataTextField="navigationName" 
            DataValueField="navigationID">
        </asp:DropDownList>
        
        <br />
        <br />
        <asp:Button ID="InsertButton" runat="server" Text="Create" OnClick="Insert" Visible="false"/>
        <asp:Button ID="UpdateButton" runat="server" Text="Update" OnClick="Update" Visible="false"/>
    </div>
</asp:Content>